package bjfuwjx.exp4;

import static bjfuwjx.exp4.RedFlag.*;

public class CountingTimeThread extends Thread{
    public boolean IsStop=true;
    public CountingTimeThread() {
        setDaemon(true);
    }
    @Override
    public void run() {
        while (true) {
            if (!IsStop) {
                long time=System.currentTimeMillis()-ProgramStartTime-PauseCount;
                init_time_text.setText(format(time));
            }
            try {
                sleep(1);
            } catch (InterruptedException e) {
                e.printStackTrace();
                System.exit(1);
            }
        }
    }
    public String format(long time) {
        int second=(int)(time/1000);
        return String.format("%d",second);
    }
}
